﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Microsoft.Xna.Framework;

using SpiritEngine;
using SpiritEngine.Components2D;


namespace SimNations.City
{
    public enum TransitTypes { None = 0,
                               Road,
                               RailRoad }
        
    public enum Zones { None = 0,
                        LightResidential, 
                        MediumResidential,
                        HeavyResidential, 
                        LightCommercial,
                        MediumCommercial,
                        HeavyCommercial, 
                        LightIndustrial,
                        MediumIndustrial,
                        HeavyIndustrial }

    public class CityTile : AComponent
    {
        // MEMBER VARIABLES
        // ------------------------------------------------------------------------------------------------------------------------

        protected CityTile m_NearestRoadTile = null;
        protected ACity m_ParentCity = null;
        protected Vector2 m_Position = Vector2.Zero;
        protected TransitTypes m_TransitType;
        protected Zones m_ZoneType;


        // CONSTRUCTORS
        // ------------------------------------------------------------------------------------------------------------------------

        public CityTile()
        {
            m_ZoneType = Zones.None;

        } // end CityTile::CityTile()

        public CityTile(float X, float Y, ACity ParentCity)
        {
            m_ParentCity = ParentCity;
            m_Position = new Vector2(X, Y);
            m_TransitType = TransitTypes.None;
            m_ZoneType = Zones.None;

        } // end CityTile::CityTile(float, float)


        // PRIVATE/PROTECTED METHODS
        // ------------------------------------------------------------------------------------------------------------------------




        // METHODS
        // ------------------------------------------------------------------------------------------------------------------------


        public override void Draw()
        {

        } // end CityTile::Draw()


        // DEBUG METHODS
        // ------------------------------------------------------------------------------------------------------------------------

#if (DEBUG)
        // put all debug methods in here...
#endif



        // PROPERTIES
        // ------------------------------------------------------------------------------------------------------------------------

        public CityTile NearestRoadTile
        {
            get
            {
                return m_NearestRoadTile;
            }
            set
            {
                m_NearestRoadTile = value;
            }
        } // end property NearestRoadTile

        public ACity ParentCity
        {
            get
            {
                return m_ParentCity;
            }
            set
            {
                if (value != null)
                    m_ParentCity = value;
            }
        } // end property ParentCity

        public Vector2 Position
        {
            get
            {
                return m_Position;
            }
            set
            {
                m_Position = value;
            }
        } // end property Position

        public virtual TransitTypes TransitType
        {
            get
            {
                return m_TransitType;
            }
            set
            {
                m_TransitType = value;
            }
        } // end property TransitType

        public virtual Zones ZoneType
        {
            get
            {
                return m_ZoneType;
            }
            set
            {
                m_ZoneType = value;
            }
        } // End property ZoneType


        // EVENTS
        // ------------------------------------------------------------------------------------------------------------------------



    } // end class CityTile
}
